package com.cellulam.framework.core.enums;

import com.cellulam.framework.core.utils.EnumHelper;
import lombok.Getter;

/**
 * JDBC type
 */
@Getter
public enum JdbcType implements CodeDescriptionFeature{

    VARCHAR(1, "varchar"),
    INTEGER(2, "integer"),
    BIGINT(3, "bigint"),
    DATE(4, "date"),
    TIMESTAMP(5, "timestamp"),
    ;

    private final int code;
    private final String description;

    JdbcType(int code, String description){
        this.code = code;
        this.description = description;
    }

    public static JdbcType valueOf(Integer code) {
        return EnumHelper.valueOf(code, JdbcType.class);
    }
}
